home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / netz / term / extras / source / term-source.lha / xem.h < prev    next >
C/C++ Source or Header  |  1994-07-30  |  6KB  |  179 lines

  1. /**
  2.  *
  3.  *   Include file for External Emulator Handling
  4.  *
  5.  **/
  6.  
  7. /*
  8.  *   The structure
  9.  */
  10.  
  11. struct XEM_IO
  12. {
  13.     struct Window    *xem_window;
  14.     struct TextFont    *xem_font;
  15.     APTR         xem_console;
  16.     STRPTR         xem_string;
  17.     ULONG        *xem_signal;
  18.     UWORD         xem_screendepth;
  19.     UWORD         xem_pad;
  20.  
  21.     ULONG        (* __asm xem_sread)(register __a0 APTR,register __d0 LONG,register __d1 ULONG);
  22.     LONG        (* __asm xem_swrite)(register __a0 STRPTR,register __d0 LONG);
  23.     LONG        (* __asm xem_sflush)(VOID);
  24.     LONG        (* __asm xem_sbreak)(VOID);
  25.     ULONG        (* __asm xem_squery)(VOID);
  26.     VOID        (* __asm xem_sstart)(VOID);
  27.     LONG        (* __asm xem_sstop)(VOID);
  28.  
  29.     VOID        (* __asm xem_tbeep)(register __d0 ULONG,register __d1 ULONG);
  30.     LONG        (* __asm xem_tgets)(register __a0 STRPTR,register __a1 STRPTR,register __d0 ULONG);
  31.     ULONG        (* __asm xem_toptions)(register __d0 LONG,register __a0 struct xem_option **);
  32.  
  33.     LONG        (* __asm xem_process_macrokeys)(register __a0 struct XEmulatorMacroKey *);
  34. };
  35.  
  36. #if 0
  37.  
  38. struct XEM_IO
  39. {
  40.     struct Window    *xem_window;
  41.     struct TextFont    *xem_font;
  42.     APTR         xem_console;
  43.     STRPTR         xem_string;
  44.     ULONG        *xem_signal;
  45.     UWORD         xem_screendepth;
  46.     UWORD         xem_pad;
  47.  
  48.     ULONG        (*xem_sread)();
  49.     LONG        (*xem_swrite)();
  50.     LONG        (*xem_sflush)();
  51.     LONG        (*xem_sbreak)();
  52.     ULONG        (*xem_squery)();
  53.     VOID        (*xem_sstart)();
  54.     LONG        (*xem_sstop)();
  55.  
  56.     VOID        (*xem_tbeep)();
  57.     LONG        (*xem_tgets)();
  58.     ULONG        (*xem_toptions)();
  59.  
  60.     LONG        (*xem_process_macrokeys)();
  61. };
  62.  
  63. #endif
  64.  
  65. /*
  66.  *   The xem_option structure
  67.  */
  68.  
  69. struct xem_option
  70. {
  71.     STRPTR    xemo_description;    /* description of the option                  */
  72.     ULONG    xemo_type;        /* type of option                             */
  73.     STRPTR    xemo_value;        /* pointer to a buffer with the current value */
  74.     ULONG    xemo_length;        /* buffer size                                */
  75. };
  76.  
  77. /*
  78.  *   Valid values for xemo_type are:
  79.  */
  80.  
  81. #define XEMO_BOOLEAN 1L         /* xemo_value is "yes", "no", "on" or "off"   */
  82. #define XEMO_LONG    2L         /* xemo_value is string representing a number */
  83. #define XEMO_STRING  3L         /* xemo_value is a string                     */
  84. #define XEMO_HEADER  4L         /* xemo_value is ignored                      */
  85. #define XEMO_COMMAND 5L         /* xemo_value is ignored                      */
  86. #define XEMO_COMMPAR 6L         /* xemo_value contains command parameters     */
  87.  
  88. struct XEmulatorMacroKey
  89. {
  90.     struct MinNode    xmk_Node;
  91.     UWORD        xmk_Qualifier;
  92.     UBYTE        xmk_Type;
  93.     UBYTE        xmk_Code;
  94.     APTR        xmk_UserData;
  95. };
  96.  
  97. /*----- Qualifiers for XMK_QUALIFIER -----*/
  98.  
  99. #define XMKQ_NONE      0
  100. #define XMKQ_SHIFT     1
  101. #define XMKQ_ALTERNATE 2
  102. #define XMKQ_CONTROL   3
  103.  
  104. /*----- Types for XMK_TYPE -----*/
  105.  
  106. #define XMKT_IGNORE 1
  107. #define XMKT_RAWKEY 2
  108. #define XMKT_COOKED 3
  109.  
  110.  
  111. /*----- Types for XEmulatorInfo -----*/
  112.  
  113. #define XEMI_CURSOR_POSITION    1    /* home = 1,1 */
  114. #define XEMI_CONSOLE_DIMENSIONS    2
  115.  
  116. /*----- Macros for XEmulatorInfo -----*/
  117.  
  118. #define XEMI_EXTRACT_Y_POSITION(result)    (result >> 16)
  119. #define XEMI_EXTRACT_X_POSITION(result)    (result & 0xffff)
  120.  
  121. #define XEMI_EXTRACT_COLUMNS(result)    (result >> 16)
  122. #define XEMI_EXTRACT_LINES(result)    (result & 0xffff)
  123.  
  124. /*----- Modes for XEmulatorPreferences -----*/
  125.  
  126. #define XEM_PREFS_RESET    0    /* Reset to builtin defaults    */
  127. #define XEM_PREFS_LOAD    1    /* Load preferences from file    */
  128. #define XEM_PREFS_SAVE    2    /* Save preferences to file    */
  129.  
  130.  
  131. struct XEmulatorHostData
  132. {
  133.     STRPTR    Source;
  134.     STRPTR    Destination;
  135.     BOOL    InESC;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  136.     BOOL    InCSI;        /* INTER-EMULATOR PRIVATE DATA..  DO NOT TOUCH 'EM..!! */
  137. };
  138.  
  139. BOOL    XEmulatorSetup(struct XEM_IO *io);
  140. BOOL    XEmulatorOpenConsole(struct XEM_IO *io);
  141. VOID    XEmulatorCloseConsole(struct XEM_IO *io);
  142. VOID    XEmulatorCleanup(struct XEM_IO *io);
  143. VOID    XEmulatorWrite(struct XEM_IO *io, STRPTR string, ULONG len);
  144. BOOL    XEmulatorSignal(struct XEM_IO *io, ULONG sig);
  145. ULONG    XEmulatorHostMon(struct XEM_IO *io, struct XEmulatorHostData *hd, ULONG actual);
  146. ULONG    XEmulatorUserMon(struct XEM_IO *io, STRPTR retstr, ULONG maxlen, struct IntuiMessage *imsg);
  147. BOOL    XEmulatorOptions(struct XEM_IO *io);
  148. BOOL    XEmulatorClearConsole(struct XEM_IO *io);
  149. BOOL    XEmulatorResetConsole(struct XEM_IO *io);
  150. BOOL    XEmulatorResetTextStyles(struct XEM_IO *io);
  151. BOOL    XEmulatorResetCharset(struct XEM_IO *io);
  152. ULONG    XEmulatorGetFreeMacroKeys(struct XEM_IO *io, ULONG qualifier);
  153. BOOL    XEmulatorMacroKeyFilter(struct XEM_IO *io, struct List *keys);
  154. ULONG    XEmulatorInfo(struct XEM_IO *xem_io, ULONG type);
  155. BOOL    XEmulatorPreferences(struct XEM_IO *xem_io, STRPTR fileName, ULONG mode);
  156.  
  157. #ifdef LATTICE
  158.  
  159. /* Pragmas for SAS/Lattice-C V5.0 */
  160.  
  161. #pragma libcall XEmulatorBase XEmulatorSetup 1E 801
  162. #pragma libcall XEmulatorBase XEmulatorOpenConsole 24 801
  163. #pragma libcall XEmulatorBase XEmulatorCloseConsole 2A 801
  164. #pragma libcall XEmulatorBase XEmulatorCleanup 30 801
  165. #pragma libcall XEmulatorBase XEmulatorWrite 36 9803
  166. #pragma libcall XEmulatorBase XEmulatorSignal 3C 802
  167. #pragma libcall XEmulatorBase XEmulatorHostMon 42 9803
  168. #pragma libcall XEmulatorBase XEmulatorUserMon 48 A09804
  169. #pragma libcall XEmulatorBase XEmulatorOptions 4E 801
  170. #pragma libcall XEmulatorBase XEmulatorClearConsole 54 801
  171. #pragma libcall XEmulatorBase XEmulatorResetConsole 5A 801
  172. #pragma libcall XEmulatorBase XEmulatorResetTextStyles 60 801
  173. #pragma libcall XEmulatorBase XEmulatorResetCharset 66 801
  174. #pragma libcall XEmulatorBase XEmulatorGetFreeMacroKeys 6c 802
  175. #pragma libcall XEmulatorBase XEmulatorMacroKeyFilter 72 9802
  176. #pragma libcall XEmulatorBase XEmulatorInfo 78 802
  177. #pragma libcall XEmulatorBase XEmulatorPreferences 7E 9803
  178. #endif
  179.